package com.service.config.utils;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.util.ArrayList;

/**
 * @author
 * @version 1.0
 * @date 2020/12/2 15:14
 */
@Data
public class LinkTree {
    /**
     *节点id
     */
    private String id;
    /**
     * 父节点id
     */
    private String pId;
    /**
     * 设备id
     */
    private String anedn;
    /**
     * 父节点设备id
     */
    private String znedn;
    /**
     * 设备名称
     */
    private String name;
    /**
     * 设备所属层高
     */
    private Integer level;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    /**
     * 子节点集合
     */
    private ArrayList<LinkTree> children;
    public void addChildren(LinkTree linkTree) {
        this.children.add(linkTree);
    }
    public LinkTree() {
        super();
        this.children = new ArrayList<>();
    }

}
